import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { BasePanel } from '../base-panel/base-panel';
import { FormBuilder } from '@angular/forms';
import { FontSizeType, TextAlignType } from 'src/app/admin/dashboard/dashboard-model';

@Component({
  selector: 'app-header-panel',
  templateUrl: './header-panel.component.html',
  styleUrls: ['../base-panel/base-panel.scss', './header-panel.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HeaderPanelComponent extends BasePanel implements OnInit {
  propertys: string[] = ['name', 'label', 'fontSize', 'textAlign'];

  sizes: string[] = [
    FontSizeType.Large,
    FontSizeType.Big,
    FontSizeType.Medium,
    FontSizeType.Small,
    FontSizeType.ExtraSmall,
  ];

  aligns: any[] = [{
    display: '左对齐',
    value: TextAlignType.Left,
  }, {
    display: '居中',
    value: TextAlignType.Center,
  }, {
    display: '右对齐',
    value: TextAlignType.Right,
  }];
  
  constructor(
    public formBuilder: FormBuilder
  ) {
    super(formBuilder);
  }

  ngOnInit() {
    this.patchValue(this.propertys);
    this.formGroupChangeValue();
  }
  
}
